﻿using System;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace RedSand.Site.Models
{
    public class NewsInfo
    {
        [Key]
        [HiddenInput(DisplayValue=false)]
        public int NewsID{ get; set; }

        [Display(Name = "Title")]
        [Required(ErrorMessage = "Title is empty")]
        public string Title{ get; set; }

        [Display(Name = "Alias")]
        [RegularExpression(@"[a-zA-Z0-9_-]*")]
        [Required(ErrorMessage = "Alias is empty")]
        public string Alias { get; set; }

        [Display(Name = "Image")]
        public string Image{ get; set; }

        [Display(Name = "Description")]
        [Required(ErrorMessage ="content is empty")]
        public string Description{ get; set; }

        [Display(Name = "Content")]
        public string Content{ get; set; }

        [Display(Name = "CreateDate")]
        [DataType(DataType.Date)]
        public DateTime? CreateDate{ get; set; }

        [Display(Name = "UserID")]
        public int? UserID{ get; set; }

        [Display(Name = "TotalView")]
        public int? TotalView { get; set; }

        [Display(Name = "TotalDownload")]
        public int? TotalDownload { get; set; }

        [Display(Name = "CategoryID")]
        [Required(ErrorMessage = "Please choose category")]
        public int? CategoryID{ get; set; }

        [Display(Name = "Status")]
        public byte? Status { get; set; }
    }
    public class NewsFullInfo : NewsInfo
    {
        [Display(Name = "Username")]
        [Required]
        public string Username { get; set; }
    }
}
